var a = getApp();

Page({
    data: {
        page: 1
    },
    onLoad: function(a) {
        this.getData();
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {
        console.log(this.data.current_page), console.log(this.data.last_page), this.data.current_page < this.data.last_page ? (wx.showLoading({
            title: "加载中",
            mask: !0
        }), this.setData({
            page: this.data.page + 1
        }), this.getNext(this.data.selected)) : wx.showToast({
            title: "没有更多",
            icon: "none"
        });
    },
    getNext: function() {
        var t = this, e = a.getNetAddresss("plugin.pending-order.frontend.member-wholesale.get-log");
        a._getNetWork({
            url: e,
            data: {
                page: this.data.page
            },
            success: function(a) {
                var e = a.data;
                if (1 == e.result) {
                    if (console.log(e), e.data.current_page > e.data.last_page) return wx.hideLoading(), 
                    wx.showToast({
                        title: "没有更多",
                        icon: "none"
                    }), void t.setData({
                        current_page: e.data.current_page,
                        last_page: e.data.last_page
                    });
                    wx.hideLoading(), t.setData({
                        info: t.data.info.concat(e.data.data),
                        current_page: e.data.current_page,
                        last_page: e.data.last_page
                    });
                } else console.log("请求失败");
            },
            fail: function(a) {
                console.log(a);
            }
        });
    },
    onShareAppMessage: function() {},
    getData: function() {
        var t = this, e = a.getNetAddresss("plugin.pending-order.frontend.member-wholesale.get-log");
        a._getNetWork({
            url: e,
            data: {
                page: this.data.page
            },
            success: function(a) {
                var e = a.data;
                1 == e.result && (console.log(e.data), t.setData({
                    info: e.data.data,
                    current_page: e.data.current_page,
                    last_page: e.data.last_page
                }));
            },
            fail: function(a) {
                console.log(a);
            }
        });
    }
});